<template>
  <el-card class="box-card">
    <div slot="header" class="clearfix">
      <span>芝麻分数</span>
      <div class="button-container">
        <el-button v-for="(button, index) in buttons" :key="index" style="padding: 3px 0" type="text"
          @click="handleButtonClick(index)">
          {{ button }}
        </el-button>
      </div>
    </div>

    <div>

    </div>
  </el-card>
</template>


<style>
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,


.box-card {
  width: 480px;
}

.button-container {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
</style>

<script>
import { listZhiMa } from "@/api/index/data/sortZhima";
export default {
  data() {
    return {
      buttons: ['今天', '昨天', '近三天', '近五天'],
      selectedIndex: 0,
    };
  },
  methods: {
    handleButtonClick(index) {
      // 根据按钮索引来确定类型，然后调用相应的函数
      switch (index) {
        case 0:
          this.handleType(0); // 今天
          break;
        case 1:
          this.handleType(1); // 昨天
          break;
        case 2:
          this.handleType(2); // 近三天
          break;
        case 3:
          this.handleType(3); // 近五天
          break;
        default:
          break;
      }
      this.selectedIndex = index;
    },
    handleType(type) {
      console.log('点击了按钮，类型为：', type);
    },
  },
};
</script>